package com.example.springboot.mapper;

import com.example.springboot.entity.PopulationStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface PopulationMapper {
    // 查询2022年的人口统计信息
    @Select("SELECT annual_average_population, birth_rate, death_rate, natural_growth_rate " +
            "FROM population_statistics " +
            "WHERE year = 2022")
    List<PopulationStatistics> select2022();

//    查询所有年的人口统计信息
    @Select("SELECT * FROM population_statistics")
    List<PopulationStatistics> selectAllYear();
}
